package com.zjw.constant;

import lombok.Getter;

/**
 * <h1>错误码枚举</h1>
 *
 * @author zjw
 * @date 2021/02/11 21:05
 */
@Getter
public enum ResultCodeEnum {

    /***
     * 通用的错误码
     */
    SUCCESS(200, "操作成功"),
    NO_OBJECT_FOUND(10001, "请求对象不存在"),
    UNKNOWN_ERROR(10002, "未知错误"),
    NO_HANDLER_FOUND(10003, "找不到执行的路径"),
    BIND_EXCEPTION_ERROR(10004, "请求参数错误"),
    ARGUMENTS_NOT_VALID_ERROR(10005, "请求参数不正确"),
    ILLEGAL_ARGUMENT_EXCEPTION(10013, "参数解析失败"),
    METHOD_NOT_ALLOWED_EXCEPTION(10015, "不支持当前请求方法"),
    HTTP_MEDIA_TYPE_NOT_SUPPORTED_EXCEPTION(10016, "不支持的媒体类型"),
    SQL_EXCEPTION(10017, "SQL执行异常"),
    LICENSE_CONTENT_EXCEPTION(10019, "证书校验不通过"),

    OTHER_ERROR(50000, "其他错误");

    private final Integer code;
    private final String message;

    ResultCodeEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }
}
